package com.wushuu.ce.http;

import com.wushuu.ce.interfaces.IBasePresenter;

import org.xutils.common.Callback;
import org.xutils.http.HttpMethod;
import org.xutils.http.RequestParams;
import org.xutils.x;

import java.util.Map;

/**
 * ============================================================
 * <br/>
 * 作 者 :        xyb
 * <br/>
 * 版 本 :        1.0
 * <br/>
 * 创建日期 ：     2016-05-11 下午10:22
 * <br/>
 * 描 述 ：
 * <br/>
 * 修订历史 ：
 * <br/>
 * ============================================================
 **/
public class HttpHelper extends BaseHttpHelper {

    private IBasePresenter presenter;
    private int responseCode;

    public HttpHelper(IBasePresenter presenter, int responseCode) {
        this.presenter = presenter;
        this.responseCode = responseCode;
    }

    @Override
    public void execute(String url, Map<String, Object> paramMaps, HttpMethod method) {
        super.execute(url, paramMaps, method);
    }

    /**
     * post请求
     */
    public void post() {
        x.http().post(mRequestParams, new BaseCommonCallBack(presenter, responseCode));
    }

    /**
     * get请求
     */
    public void get() {
        x.http().get(mRequestParams, new BaseCommonCallBack(presenter, responseCode));
    }


}
